<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateVirtueLog extends Migrator
{
    public function up(){
        $table = $this->table('virtue_log',['comment'=>'功德流水表']);
//        $table->addColumn('user_id','integer',['limit'=>10,'comment'=>'用户id'])
//            ->addForeignKey('user_id', 'user', 'id', ['delete'=> 'CASCADE'])
//            ->addColumn('type','integer',['limit'=>1,'comment'=>'增减 1增 -1减少'])
//            ->addColumn('change_score','integer',['limit'=>4,'signed'=>false,'comment'=>'变动的积分'])
//            ->addColumn('able_score','integer',['limit'=>10,'signed'=>false,'comment'=>'变动后的积分'])
//            ->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'comment'=>'创建时间'])
//            ->create();
    }
    public function down(){
        $this->dropTable('virtue_log');
    }
}
